package com.zpl.order.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zpl.entity.BaseEntity;
import com.zpl.order.enums.DeleteStatus;
import com.zpl.order.enums.OrderStatus;
import com.zpl.order.enums.PaymentMethod;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Data
@ApiModel(value = "订单", description = "订单实体")
@TableName("`order`")
public class Order extends BaseEntity {
    @ApiModelProperty(value = "会员id", required = true)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField(value="member_id")
    private Long memberId;
    @ApiModelProperty(value = "收货人姓名", required = true)
    @TableField(value="shipping_user")
    private String shippingUser;
    @ApiModelProperty(value = "地址id", required = true)
    @JsonFormat(shape = JsonFormat.Shape.STRING)
    @TableField(value="address_id")
    private Long addressId;
    @ApiModelProperty(value = "支付方式：1现金，2余额，3网银，4支付宝，5微信", required = true)
    @TableField(value="payment_method")
    private PaymentMethod paymentMethod;
    @ApiModelProperty(value = "订单金额", required = true)
    @TableField(value="order_money")
    private BigDecimal orderMoney;
    @ApiModelProperty(value = "优惠金额", required = true)
    @TableField(value="district_money")
    private BigDecimal districtMoney;
    @ApiModelProperty(value = "运费金额", required = true)
    @TableField(value="shipping_money")
    private BigDecimal shippingMoney;
    @ApiModelProperty(value = "支付金额", required = true)
    @TableField(value="payment_money")
    private BigDecimal paymentMoney;
    @ApiModelProperty(value = "快递公司名称", required = true)
    @TableField(value="shipping_comp_name")
    private String shippingCompName;
    @ApiModelProperty(value = "快递单号", required = true)
    @TableField(value="shipping_sn")
    private String shippingSn;
    @ApiModelProperty(value = "下单时间", required = true)
    @TableField(value="order_time")
    private LocalDate orderTime;
    @ApiModelProperty(value = "发货时间", required = true)
    @TableField(value="shipping_time")
    private LocalDate shippingTime;
    @ApiModelProperty(value = "支付时间", required = true)
    @TableField(value="pay_time")
    private LocalDate payTime;
    @ApiModelProperty(value = "收货时间", required = true)
    @TableField(value="receive_time")
    private LocalDate receiveTime;
    @ApiModelProperty(value = "订单状态 0已下单 1已发货 2已收货 3退货", required = true)
    @TableField(value="order_status")
    private OrderStatus orderStatus;
    @ApiModelProperty(value = "订单积分", required = true)
    @TableField(value="order_point")
    private int orderPoint;
    @ApiModelProperty(value = "是否被会员删除", required = true)
    @TableField(value="delete_status")
    private DeleteStatus deleteStatus;
    @ApiModelProperty(value = "发票抬头", required = true)
    @TableField(value="invoice_time")
    private String invoiceTime;
}
